home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / ax_mbx.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  3KB  |  101 lines

  1. /* see comment at the head of ax_mbx.c - Bdale */
  2. #ifdef XOBBS
  3. /* Defines for the ax.25 mailbox facility */
  4.  
  5. #define true      1
  6. #define false     0
  7.  
  8. /*message que keys*/
  9. #define SENDKEY 200
  10. #define RCVKEY 201
  11. #define SCTLKEY 202
  12. #define RCTLKEY 203
  13.  
  14. /*defines that control forwarder states */
  15.  
  16. #define NOFWD     0
  17. #define SPAWNBBS  1
  18. #define DOCONNECT 2
  19. #define READXMIT  3
  20. #define GETCON    4
  21. #define CLEARCON  5
  22. #define WAITING   6
  23.  
  24. #define NOCON     0    
  25. #define YESCON    1
  26. #define WAIT      2
  27.  
  28. struct message{
  29.     long mtype;
  30.     char mtext[1024];
  31. };
  32.  
  33. /* defines for protocol type in mailbox session structure*/
  34. #define AX25      1
  35. #define NTRM      2
  36.  
  37. struct mboxsess{        /*mailbox session structure*/
  38.     int proto;        /*is this a net/rom or ax25 session?*/
  39.     int pid;        /*id of bbs process*/
  40.     int bytes;        /*number of bytes for bbs to send at one time*/
  41.     int gotbytes;        /*number of bytes we have in buffer*/
  42.     union cbaddr {
  43.         struct ax25_cb *axbbscb; /*axp associated with this structure*/
  44.         struct nr4cb *axnrcb;   /* cb associated with the structure*/
  45.     } cbadr;
  46.     struct message rmsgbuf;  /*receive message buffer for this structure*/
  47.     char call[7];        /*call of user*/
  48.     char *mtxtptr;        /*buffer pointer for this structure*/
  49.     struct mboxsess *next;    /*pointer to next session*/
  50. };
  51.  
  52. #define NULLMBS  (struct mboxsess *)0
  53. #define NULLFWD  (struct ax25_cb *)0
  54. #define FWDTMP    "/tmp/fwdtmp"
  55. extern int ax25mbox ;
  56.  
  57. #else /* not XOBBS */
  58.  
  59. /* Defines for the ax.25 mailbox facility */
  60.  
  61. #define NUMMBX        10        /* max number of mailbox sessions */
  62.  
  63. #define MBXLINE        128        /* max length of line */
  64. struct mbx {
  65.     int state ;                /* mailbox state */
  66. #define MBX_CMD        1        /* in command mode */
  67. #define MBX_SUBJ    2        /* waiting for a subject line */
  68. #define MBX_DATA    3        /* collecting the message */
  69.     int type ;                /* type of connection */
  70. #define MBX_AX25    1        /* ax25 connection */
  71. #define MBX_NETROM    2        /* net/rom transport connection */
  72.     char name[10] ;            /* Name of remote station */
  73.     union {
  74.         struct ax25_cb    *ax25_cb ;    /* ax.25 link control block */
  75.         struct nr4cb *nr4_cb ;        /* net/rom link control block */
  76.     } cb ;
  77.     char *to ;                /* To-address in form user or user@host */
  78.     char *tofrom ;            /* Optional <from in to-address */
  79.     char *tomsgid ;            /* Optional $msgid in to-address */
  80.     FILE *tfile ;            /* Temporary file for message */
  81.     char line[MBXLINE+1] ;    /* Room for null at end */
  82.     char *lp ;                /* line pointer */
  83.     int mbnum ;                /* which mailbox session is this? */
  84.     int sid ;                /* Characteristics indicated by the SID */
  85.                             /* banner of the attaching station.  If */
  86.                             /* no SID was sent, this is zero.  If an */
  87.                             /* SID of any kind was received, it is */
  88.                             /* assumed that the station supports */
  89.                             /* abbreviated mail forwarding mode. */
  90. #define    MBX_SID        0x01    /* Got any SID */
  91. #define    MBX_SID_RLI    0x02    /* This is an RLI BBS, disconnect after F> */
  92.                             /* Space here for others, currently not of */
  93.                             /* interest to us. */
  94.     char stype ;            /* BBS send command type (B,P,T, etc.) */
  95. } ;
  96. #define     NULLMBX        (struct mbx *)0
  97.  
  98. extern struct mbx *mbox[NUMMBX] ;
  99. extern int ax25mbox ;
  100. #endif /* XOBBS */
  101.